﻿using Abp.Domain.Repositories;
using KelonProud.Administration.Domain.Authorization;
using KelonProud.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KelonProud.QuickQuery.Managers
{
    public class QueryGridManager : KelonProudDomainService<Navigation>
    {
        public QueryGridManager(IRepository<Navigation, int> manageRepository) : base(manageRepository)
        {
        }

        public bool NameIsExists(int? tenantId, int id,string name) {
            return Query.Any(a => a.TenantId == tenantId && id != a.Id && a.Name == name);
        }

        public bool CodeIsExists(int? tenantId,int id, string code) {
            return Query.Any(a => a.TenantId == tenantId && id != a.Id && a.Code == code);
        }
    }
}
